//
//  YXCollectionViewVC.m
//  YXKitOC
//
//  Created by zhxin on 2020/8/13.
//  Copyright © 2020 张鑫. All rights reserved.
//

#import "YXCollectionViewVC.h"
#import "YXCollectionView.h"
#import "YXKitOC.h"
#import "CollectionViewCell_Xib.h"

@interface YXCollectionViewVC ()

@end

@implementation YXCollectionViewVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    YXCollectionView *collectionView = [[YXCollectionView alloc] initWithFrame:CGRectMake(0, YX_SafeArea_Top(), self.view.width, self.view.height - YX_SafeArea_Top()) config:[[YXCollectionViewConfig alloc] init]];
    collectionView.backgroundColor = YX_RandomColor();
    
    [collectionView registCells:@[[CollectionViewCell_Xib class]] returnClass:^Class _Nonnull(UICollectionView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
        return [CollectionViewCell_Xib class];
    } loadCell:^(UICollectionView * _Nonnull tableView, id  _Nonnull loadCell, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
        
    } returnSize:^CGSize(UICollectionView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
        return CGSizeMake(100, 100);
    } didSelected:^(UICollectionView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
        
    } loadData:^(NSInteger pageIndex, NSInteger pageSize, YXCStatusBlock  _Nonnull statusBlock) {
        statusBlock(nil, @[@"", @""]);
    }];
    
    [collectionView refresh];
    
    [self.view addSubview:collectionView];
}

@end
